<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Extracts/decodes a message section</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.mailparse-msg-create.html">« mailparse_msg_create</a></li>
      <li style="float: right;"><a href="function.mailparse-msg-extract-part.html">mailparse_msg_extract_part »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.mailparse.html">Mailparse 函数</a></li>
    <li>Extracts/decodes a message section</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.mailparse-msg-extract-part-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mailparse_msg_extract_part_file</h1>
  <p class="verinfo">(PECL mailparse &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">mailparse_msg_extract_part_file</span> &mdash; <span class="dc-title">Extracts/decodes a message section</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mailparse-msg-extract-part-file-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mailparse_msg_extract_part_file</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$mimemail</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callbackfunc</code><span class="initializer"> = ?</span></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Extracts/decodes a message section from the supplied filename.
  </p>
  <p class="para">
   The contents of the section will be decoded according to their transfer
   encoding - base64, quoted-printable and uuencoded text are supported.  
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mailparse-msg-extract-part-file-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">mimemail</code></dt>

     <dd>

      <p class="para">
       A valid <code class="literal">MIME</code> resource, created with
       <span class="function"><a href="function.mailparse-msg-create.html" class="function">mailparse_msg_create()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
       Can be a file name or a valid stream resource.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">callbackfunc</code></dt>

     <dd>

      <p class="para">
       If set, this must be either a valid callback that will be passed the
       extracted section, or <strong><code>null</code></strong> to make this function return the
       extracted section.
      </p>
      <p class="para">
       If not specified, the contents will be sent to &quot;stdout&quot;.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mailparse-msg-extract-part-file-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   If <code class="parameter">callbackfunc</code> is not <strong><code>null</code></strong> returns <strong><code>true</code></strong> on
   success.
  </p>
  <p class="para">
   If <code class="parameter">callbackfunc</code> is set to <strong><code>null</code></strong>, returns the
   extracted section as a string.
  </p>
  <p class="para">
   Returns <strong><code>false</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mailparse-msg-extract-part-file-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.mailparse-msg-extract-part.html" class="function" rel="rdfs-seeAlso">mailparse_msg_extract_part()</a> - Extracts/decodes a message section</span></li>
    <li class="member"><span class="function"><a href="function.mailparse-msg-extract-whole-part-file.html" class="function" rel="rdfs-seeAlso">mailparse_msg_extract_whole_part_file()</a> - Extracts a message section including headers without decoding the transfer encoding</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>